import {WELL_TYPE} from "../store/constants";

export const WELL_WIDTH = 68;
export const WELL_LEFT = 71;
export const WELLS_COLUMN = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
export const WELLS_ROW = ["A", "B", "C", "D", "E", "F", "G", "H"];
export const WELLS_COUNTER = [
  {name: WELL_TYPE.UNK, color: "#00B7FA", count: 0},
  {name: WELL_TYPE.NTC, color: "#FF992B", count: 0},
  {name: WELL_TYPE.POS, color: "#FF2720", count: 0},
  {name: WELL_TYPE.NEG, color: "#FF41FF", count: 0},
  {name: WELL_TYPE.NRT, color: "#97AAFF", count: 0},
  {name: WELL_TYPE.STD, color: "#32C243", count: 0},
  {name: "Empty", color: "", count: 96}];
export const WELLS_COUNTER_CN = [
  {name: WELL_TYPE.UNK, color: "#00B7FA", count: 0},
  {name: WELL_TYPE.NTC, color: "#FF992B", count: 0},
  {name: WELL_TYPE.POS, color: "#FF2720", count: 0},
  {name: WELL_TYPE.NEG, color: "#FF41FF", count: 0},
  {name: WELL_TYPE.NRT, color: "#97AAFF", count: 0},
  {name: WELL_TYPE.STD, color: "#32C243", count: 0},
  {name: "空孔", color: "", count: 96}];
export const MENU_STYLE = {
  textAlign: "center",
  width: "90px",
  border: "1px solid #213040",
  borderRadius: "5px",
  overflow: "hidden"
};

let sampleTask = {};
sampleTask[WELL_TYPE.UNK] = "#00B7FA";
sampleTask[WELL_TYPE.NTC] = "#FF992B";
sampleTask[WELL_TYPE.POS] = "#FF2720";
sampleTask[WELL_TYPE.NEG] = "#FF41FF";
sampleTask[WELL_TYPE.NRT] = "#97AAFF";
sampleTask[WELL_TYPE.STD] = "#32C243";
sampleTask[WELL_TYPE.UNDEFINED] = "";
export const SAMPLE_TASK = sampleTask;

export const LINE_OBJ = {
  omit: false,
  sigLevel: 5.0,
  baseStartCycle: 3,
  baseEndCycle: 15,
  cq: -1.0,
  cqMean: -1.0,
  cqSd: -1.0,
  sq: -1.0,
  sqMean: -1.0,
  sqSd: -1.0,
  quantificationOrigin: [],
  quantificationBaseline: [],
  quantificationCurveFitter: [],
  quantificationOpt: []
};

export function getWells() {
  let wells = [];
  for (let i = 0; i < 8; i++) {
    for (let j = 0; j < 12; j++) {
      wells.push({
        col: j,
        row: i,
        show: true,
        selected: false,
        type: WELL_TYPE.UNDEFINED,
        sampleName: "",
        sampleUuid: "",
        sampleColor: "",
        sampleControl: false,
        lines: [{...LINE_OBJ}, {...LINE_OBJ}, {...LINE_OBJ}, {...LINE_OBJ}, {...LINE_OBJ}, {...LINE_OBJ}],
        targets: [],
        meltData: [],
        meltPeak: [],
        meltTemperature: -1.0,
        groupName: "",
        groupColor: "",
        groupUuid: "",
        heatMapColor: ""
      });
    }
  }
  return wells;
}

export function getAllelicTableWells() {
  let wells = [];
  for (let i = 0; i < 8; i++) {
    for (let j = 0; j < 12; j++) {
      wells.push({
        col: j,
        row: i,
        icon: "",
        call: ""
      });
    }
  }
  return wells;
}